﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:YALV.View.Components"
             xmlns:Strings="clr-namespace:YalvLib.Strings;assembly=YalvLib"
             xmlns:converters="clr-namespace:YalvLib.Common.Converters;assembly=YalvLib"
             x:Class="YALV.View.Components.TextMarkerToolBoxView" 
                                
              mc:Ignorable="d"
              d:DesignHeight="300" d:DesignWidth="500"             
>
  <UserControl.Resources>
    <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
  </UserControl.Resources>

  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <Label Grid.Column="0" Grid.Row="0"
           Content="{x:Static Strings:Resources.MainWindow_MarkerBox_Title_Text}" 
           HorizontalAlignment="Left" 
           VerticalAlignment="Top" 
           FontSize="20"
          />

    <CheckBox Margin="3" Grid.Column="1" Grid.Row="0"
              VerticalAlignment="Center" HorizontalAlignment="Right"
              Content="{x:Static Strings:Resources.MainWindow_Markerbox_Checkbox_Text}"
              IsChecked="{Binding Path=ManageTextMarkersViewModel.DisplayOnlyCommonMarkers}"
          />

    <Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
        
            <local:TextMarkerView Grid.Row="0"
                x:Name="TextMarkerAdd"
                DataContext="{Binding Path=ManageTextMarkersViewModel.TextMarkerToAdd}"
        />
        <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
        <ItemsControl Name="TextMarkersToDisplay"
                          HorizontalAlignment="Stretch" 
                          VerticalAlignment="Stretch"
                ItemsSource="{Binding Path=ManageTextMarkersViewModel.TextMarkerViewModels}" >
          <ItemsControl.ItemTemplate>
            <DataTemplate>
                      <local:TextMarkerView />
            </DataTemplate>
          </ItemsControl.ItemTemplate>
        </ItemsControl>
      </ScrollViewer>
    </Grid>

  </Grid>
</UserControl>
